import request from '@/utils/request'

// 获取企业的部门列表
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

// 获取 部门详情 删除
export function DeletDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 新增数据
export function addDepartments(data) {
  return request({
    url: `/company/department/`,
    method: 'post',
    data // axios的body参数 对应 data
  })
}

// 获取 部门详情数据 编辑
export function getDeparDetails(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 保存编辑部门
export function updataDetails(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
